/**
 * @Author: Caven
 * @Date: 2020-01-15 20:31:28
 */
import mapImage from '@/assets/js/map/mapImagery.js'
import AmapMercatorTilingScheme from './AmapMercatorTilingScheme'

class AmapImageryProvider extends Cesium.UrlTemplateImageryProvider {
  constructor(options = {}) {
    options['url'] = options.mapImage.url || mapImage['高德地图-矢量底图'].url
    if (!options.subdomains || !options.subdomains.length) {
      options['subdomains'] = ['01', '02', '03', '04']
    }
    if (options.crs === 'WGS84') {
      options['tilingScheme'] = new AmapMercatorTilingScheme()
    }
    super(options)
  }
}
export default AmapImageryProvider
